x86: a few optimizations to psr codes
authorYi Sun <yi.y.sun@linux.intel.com>
Fri, 20 Oct 2017 08:50:00 +0000 (10:50 +0200)
committerJan Beulich <jbeulich@suse.com>
Fri, 15 Dec 2017 10:04:09 +0000 (11:04 +0100)
commitd7714b2b7bac8d9ea1698793c9d040ee04c61201
tree54f3709c68e65f9b97829330b3fa52976cd57be1
parentd6c683d846c2018934c52bb59fcd2d6980ebb6c4
x86: a few optimizations to psr codes

This patch refines psr codes:
1. Change type of 'cat_init_feature' to 'bool' to remove the pointless
   returning of error code.
2. Move printk in 'cat_init_feature' to reduce a return path.
3. Define a local variable 'feat_mask' in 'psr_cpu_init' to reduce calling of
   'cpuid_count_leaf()'.
4. Change 'PSR_INFO_IDX_CAT_FLAG' to 'PSR_INFO_IDX_CAT_FLAGS'.

Signed-off-by: Yi Sun <yi.y.sun@linux.intel.com>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/psr.c
xen/arch/x86/sysctl.c
xen/include/asm-x86/psr.h